﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace SurfaceCardsGameKit
{
    [Serializable]
    public class SimpleMonitor : IDisposable
    {
        private int _busyCount;

        public bool Busy
        {
            get { return this._busyCount > 0; }
        }

        public void Enter()
        {
            this._busyCount++;
        }

        #region Implementation of IDisposable

        public void Dispose()
        {
            this._busyCount--;
        }

        #endregion
    }
}
